package com.rightsidetech.mall.mapper;


import com.rightsidetech.mall.dto.request.CommodityActivityPageReq;
import com.rightsidetech.mall.dto.request.CommodityPageReq;
import com.rightsidetech.mall.dto.response.*;
import com.rightsidetech.mall.dto.response.userApp.CommodityAppDetailResp;
import com.rightsidetech.mall.dto.response.userApp.CommodityAppPageResp;
import com.rightsidetech.mall.entity.MallCommodity;
import com.rightsidetech.mall.entity.MallCommodityWithBLOBs;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface MallCommodityMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MallCommodityWithBLOBs record);

    int insertSelective(MallCommodityWithBLOBs record);

    MallCommodityWithBLOBs selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MallCommodityWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(MallCommodityWithBLOBs record);

    int updateByPrimaryKey(MallCommodity record);

    CommodityDetailResp selectDetailRespById(Long id);

    List<CommodityPageResp> selectCommodityPageList(CommodityPageReq req);
    Integer selectCommodityPageList_COUNT(CommodityPageReq req);

    CommodityOrderDetailResp findOrderDetailByCommodityId(@Param("commodityId") Long commodityId);

    List<CommodityAgentResp> selectAgentPageList(Map<String, Object> map);

    MallCommodityWithBLOBs selectBySortDesc();

    List<CommodityAppPageResp> selectAppCommodityPage(@Param("typeId") Long typeId,@Param("agentId") Long agentId);

    CommodityAppDetailResp selectAppDetailById(Long id);

    int updateSortById(@Param("id") Long id,@Param("sort") Long sort);

    Byte selectCommodityStatusById(Long id);

    List<MallCommodity> selectByIds(List<Long> list);

    String selectImg(Long id);

    List<CommoditySearchResp> selectIdAndName(String commodityName);

    List<CommoditySearchResp> selectNoIntegral(String commodityName);

    List<CommodityInfoResp> selectCommInfo(@Param("id")Long id,@Param("agentId")Long agentId);

    CommodityImportResp selectByCommodityName(@Param("commodityName") String commodityName);

    List<CommodityPageResp> selectCommodityActivityPageList(CommodityActivityPageReq req);
}